Optimal. Leaf size=274 \[ -\frac {2 i b^2 x^{3/2}}{d}+\frac {a^2 x^2}{2}+i a b x^2-\frac {b^2 x^2}{2}+\frac {6 b^2 x \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{3/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {6 i b^2 \sqrt {x} \text {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {6 i a b x \text {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {3 b^2 \text {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {6 a b \sqrt {x} \text {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {3 i a b \text {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {2 b^2 x^{3/2} \tan \left (c+d \sqrt {x}\right )}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.32, antiderivative size = 274, normalized size of antiderivative = 1.00, number of steps
used = 16, number of rules used = 10, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.556, Rules used = {3832, 3803,
3800, 2221, 2611, 6744, 2320, 6724, 3801, 30} \begin {gather*} \frac {a^2 x^2}{2}-\frac {3 i a b \text {Li}_4\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {6 a b \sqrt {x} \text {Li}_3\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {6 i a b x \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{3/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+i a b x^2+\frac {3 b^2 \text {Li}_3\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {6 i b^2 \sqrt {x} \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {6 b^2 x \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {2 b^2 x^{3/2} \tan \left (c+d \sqrt {x}\right )}{d}-\frac {2 i b^2 x^{3/2}}{d}-\frac {1}{2} b^2 x^2 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2221
Rule 2320
Rule 2611
Rule 3800
Rule 3801
Rule 3803
Rule 3832
Rule 6724
Rule 6744
Rubi steps
\begin {align*} \int x \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx &=2 \text {Subst}\left (\int x^3 (a+b \tan (c+d x))^2 \, dx,x,\sqrt {x}\right )\\ &=2 \text {Subst}\left (\int \left (a^2 x^3+2 a b x^3 \tan (c+d x)+b^2 x^3 \tan ^2(c+d x)\right ) \, dx,x,\sqrt {x}\right )\\ &=\frac {a^2 x^2}{2}+(4 a b) \text {Subst}\left (\int x^3 \tan (c+d x) \, dx,x,\sqrt {x}\right )+\left (2 b^2\right ) \text {Subst}\left (\int x^3 \tan ^2(c+d x) \, dx,x,\sqrt {x}\right )\\ &=\frac {a^2 x^2}{2}+i a b x^2+\frac {2 b^2 x^{3/2} \tan \left (c+d \sqrt {x}\right )}{d}-(8 i a b) \text {Subst}\left (\int \frac {e^{2 i (c+d x)} x^3}{1+e^{2 i (c+d x)}} \, dx,x,\sqrt {x}\right )-\left (2 b^2\right ) \text {Subst}\left (\int x^3 \, dx,x,\sqrt {x}\right )-\frac {\left (6 b^2\right ) \text {Subst}\left (\int x^2 \tan (c+d x) \, dx,x,\sqrt {x}\right )}{d}\\ &=-\frac {2 i b^2 x^{3/2}}{d}+\frac {a^2 x^2}{2}+i a b x^2-\frac {b^2 x^2}{2}-\frac {4 a b x^{3/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {2 b^2 x^{3/2} \tan \left (c+d \sqrt {x}\right )}{d}+\frac {(12 a b) \text {Subst}\left (\int x^2 \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d}+\frac {\left (12 i b^2\right ) \text {Subst}\left (\int \frac {e^{2 i (c+d x)} x^2}{1+e^{2 i (c+d x)}} \, dx,x,\sqrt {x}\right )}{d}\\ &=-\frac {2 i b^2 x^{3/2}}{d}+\frac {a^2 x^2}{2}+i a b x^2-\frac {b^2 x^2}{2}+\frac {6 b^2 x \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{3/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {6 i a b x \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {2 b^2 x^{3/2} \tan \left (c+d \sqrt {x}\right )}{d}-\frac {(12 i a b) \text {Subst}\left (\int x \text {Li}_2\left (-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2}-\frac {\left (12 b^2\right ) \text {Subst}\left (\int x \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2}\\ &=-\frac {2 i b^2 x^{3/2}}{d}+\frac {a^2 x^2}{2}+i a b x^2-\frac {b^2 x^2}{2}+\frac {6 b^2 x \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{3/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {6 i b^2 \sqrt {x} \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {6 i a b x \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 a b \sqrt {x} \text {Li}_3\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {2 b^2 x^{3/2} \tan \left (c+d \sqrt {x}\right )}{d}+\frac {(6 a b) \text {Subst}\left (\int \text {Li}_3\left (-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^3}+\frac {\left (6 i b^2\right ) \text {Subst}\left (\int \text {Li}_2\left (-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^3}\\ &=-\frac {2 i b^2 x^{3/2}}{d}+\frac {a^2 x^2}{2}+i a b x^2-\frac {b^2 x^2}{2}+\frac {6 b^2 x \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{3/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {6 i b^2 \sqrt {x} \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {6 i a b x \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {6 a b \sqrt {x} \text {Li}_3\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {2 b^2 x^{3/2} \tan \left (c+d \sqrt {x}\right )}{d}-\frac {(3 i a b) \text {Subst}\left (\int \frac {\text {Li}_3(-x)}{x} \, dx,x,e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {\left (3 b^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}\\ &=-\frac {2 i b^2 x^{3/2}}{d}+\frac {a^2 x^2}{2}+i a b x^2-\frac {b^2 x^2}{2}+\frac {6 b^2 x \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{3/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {6 i b^2 \sqrt {x} \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {6 i a b x \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {3 b^2 \text {Li}_3\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {6 a b \sqrt {x} \text {Li}_3\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {3 i a b \text {Li}_4\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {2 b^2 x^{3/2} \tan \left (c+d \sqrt {x}\right )}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.31, size = 267, normalized size = 0.97 \begin {gather*} -\frac {2 i b e^{2 i c} \left (2 b x^{3/2}-a d x^2-\frac {e^{-2 i c} \left (1+e^{2 i c}\right ) \left (2 i d^2 \left (-3 b x^{3/2}+2 a d x^2\right ) \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )+6 d \left (-b x+a d x^{3/2}\right ) \text {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )+3 i \left (-b \sqrt {x}+2 a d x\right ) \text {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )-3 a \sqrt {x} \text {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )\right )}{2 d^3 \sqrt {x}}\right )}{d \left (1+e^{2 i c}\right )}+\frac {2 b^2 x^{3/2} \sec (c) \sec \left (c+d \sqrt {x}\right ) \sin \left (d \sqrt {x}\right )}{d}+\frac {1}{2} x^2 \left (a^2-b^2+2 a b \tan (c)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.84, size = 0, normalized size = 0.00 \[\int x \left (a +b \tan \left (c +d \sqrt {x}\right )\right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 1290 vs. \(2 (218) = 436\).
time = 0.61, size = 1290, normalized size = 4.71 \begin {gather*} \frac {{\left (d \sqrt {x} + c\right )}^{4} a^{2} - 4 \, {\left (d \sqrt {x} + c\right )}^{3} a^{2} c + 6 \, {\left (d \sqrt {x} + c\right )}^{2} a^{2} c^{2} - 4 \, {\left (d \sqrt {x} + c\right )} a^{2} c^{3} - 8 \, a b c^{3} \log \left (\sec \left (d \sqrt {x} + c\right )\right ) - \frac {4 \, {\left (12 i \, {\left (d \sqrt {x} + c\right )} b^{2} c^{3} - 3 \, {\left (2 \, a b + i \, b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{4} + 12 \, {\left (2 \, a b + i \, b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{3} c - 18 \, {\left (2 \, a b + i \, b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} c^{2} + 24 \, b^{2} c^{3} + 4 \, {\left (8 \, {\left (d \sqrt {x} + c\right )}^{3} a b - 9 \, b^{2} c^{2} - 9 \, {\left (2 \, a b c + b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} + 18 \, {\left (a b c^{2} + b^{2} c\right )} {\left (d \sqrt {x} + c\right )} + {\left (8 \, {\left (d \sqrt {x} + c\right )}^{3} a b - 9 \, b^{2} c^{2} - 9 \, {\left (2 \, a b c + b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} + 18 \, {\left (a b c^{2} + b^{2} c\right )} {\left (d \sqrt {x} + c\right )}\right )} \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) - {\left (-8 i \, {\left (d \sqrt {x} + c\right )}^{3} a b + 9 i \, b^{2} c^{2} + 9 \, {\left (2 i \, a b c + i \, b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} + 18 \, {\left (-i \, a b c^{2} - i \, b^{2} c\right )} {\left (d \sqrt {x} + c\right )}\right )} \sin \left (2 \, d \sqrt {x} + 2 \, c\right )\right )} \arctan \left (\sin \left (2 \, d \sqrt {x} + 2 \, c\right ), \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) + 1\right ) - 3 \, {\left ({\left (2 \, a b + i \, b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{4} - 4 \, {\left (2 \, b^{2} + {\left (2 \, a b + i \, b^{2}\right )} c\right )} {\left (d \sqrt {x} + c\right )}^{3} + 6 \, {\left (4 \, b^{2} c + {\left (2 \, a b + i \, b^{2}\right )} c^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} + 4 \, {\left (-i \, b^{2} c^{3} - 6 \, b^{2} c^{2}\right )} {\left (d \sqrt {x} + c\right )}\right )} \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) - 12 \, {\left (4 \, {\left (d \sqrt {x} + c\right )}^{2} a b + 3 \, a b c^{2} + 3 \, b^{2} c - 3 \, {\left (2 \, a b c + b^{2}\right )} {\left (d \sqrt {x} + c\right )} + {\left (4 \, {\left (d \sqrt {x} + c\right )}^{2} a b + 3 \, a b c^{2} + 3 \, b^{2} c - 3 \, {\left (2 \, a b c + b^{2}\right )} {\left (d \sqrt {x} + c\right )}\right )} \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) + {\left (4 i \, {\left (d \sqrt {x} + c\right )}^{2} a b + 3 i \, a b c^{2} + 3 i \, b^{2} c + 3 \, {\left (-2 i \, a b c - i \, b^{2}\right )} {\left (d \sqrt {x} + c\right )}\right )} \sin \left (2 \, d \sqrt {x} + 2 \, c\right )\right )} {\rm Li}_2\left (-e^{\left (2 i \, d \sqrt {x} + 2 i \, c\right )}\right ) - 2 \, {\left (8 i \, {\left (d \sqrt {x} + c\right )}^{3} a b - 9 i \, b^{2} c^{2} + 9 \, {\left (-2 i \, a b c - i \, b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} + 18 \, {\left (i \, a b c^{2} + i \, b^{2} c\right )} {\left (d \sqrt {x} + c\right )} + {\left (8 i \, {\left (d \sqrt {x} + c\right )}^{3} a b - 9 i \, b^{2} c^{2} + 9 \, {\left (-2 i \, a b c - i \, b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} + 18 \, {\left (i \, a b c^{2} + i \, b^{2} c\right )} {\left (d \sqrt {x} + c\right )}\right )} \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) - {\left (8 \, {\left (d \sqrt {x} + c\right )}^{3} a b - 9 \, b^{2} c^{2} - 9 \, {\left (2 \, a b c + b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} + 18 \, {\left (a b c^{2} + b^{2} c\right )} {\left (d \sqrt {x} + c\right )}\right )} \sin \left (2 \, d \sqrt {x} + 2 \, c\right )\right )} \log \left (\cos \left (2 \, d \sqrt {x} + 2 \, c\right )^{2} + \sin \left (2 \, d \sqrt {x} + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) + 1\right ) + 24 \, {\left (a b \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) + i \, a b \sin \left (2 \, d \sqrt {x} + 2 \, c\right ) + a b\right )} {\rm Li}_{4}(-e^{\left (2 i \, d \sqrt {x} + 2 i \, c\right )}) - 6 \, {\left (8 i \, {\left (d \sqrt {x} + c\right )} a b - 6 i \, a b c - 3 i \, b^{2} + {\left (8 i \, {\left (d \sqrt {x} + c\right )} a b - 6 i \, a b c - 3 i \, b^{2}\right )} \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) - {\left (8 \, {\left (d \sqrt {x} + c\right )} a b - 6 \, a b c - 3 \, b^{2}\right )} \sin \left (2 \, d \sqrt {x} + 2 \, c\right )\right )} {\rm Li}_{3}(-e^{\left (2 i \, d \sqrt {x} + 2 i \, c\right )}) - 3 \, {\left ({\left (2 i \, a b - b^{2}\right )} {\left (d \sqrt {x} + c\right )}^{4} + 4 \, {\left (-2 i \, b^{2} + {\left (-2 i \, a b + b^{2}\right )} c\right )} {\left (d \sqrt {x} + c\right )}^{3} + 6 \, {\left (4 i \, b^{2} c + {\left (2 i \, a b - b^{2}\right )} c^{2}\right )} {\left (d \sqrt {x} + c\right )}^{2} + 4 \, {\left (b^{2} c^{3} - 6 i \, b^{2} c^{2}\right )} {\left (d \sqrt {x} + c\right )}\right )} \sin \left (2 \, d \sqrt {x} + 2 \, c\right )\right )}}{-12 i \, \cos \left (2 \, d \sqrt {x} + 2 \, c\right ) + 12 \, \sin \left (2 \, d \sqrt {x} + 2 \, c\right ) - 12 i}}{2 \, d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x \left (a + b \tan {\left (c + d \sqrt {x} \right )}\right )^{2}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int x\,{\left (a+b\,\mathrm {tan}\left (c+d\,\sqrt {x}\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________